package edu.hawaii.duedates;

import org.junit.Test;
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.List;

/**
 * Implements testing of the CommandFields class.
 * 
 * @author Aric West
 * @author Daniel Tian
 */
public class TestDueDatesOption {
  DueDatesOption option;
  List<String> args;
  
  /**
   * Testing DueDatesOption class.
   */
  public TestDueDatesOption() {
    args = new ArrayList<String>();
    args.add("-test");
    args.add("one");
    args.add("two");
    args.add("three");
    
    option = new DueDatesOption(args);
  }

  /**
   * Testing basic operations of the CommandFields class.
   */
  @Test
  public void testGetCommand() {
    System.out.println(args.get(0));
    System.out.println(option.getCommand());
    assertEquals("Testing get command", option.getCommand(), args.get(0));
  }
  
  /**
   * Testing getParameters.
   */
  @Test
  public void testGetParameters() {
    args.remove(0);
    assertEquals("Testing get parameters", option.getParameters(), args);
  }
  
  /**
   * Test getParameterAt.
   */
  @Test
  public void testGetParameterAt() {
    args.remove(0);
    assertEquals("Testing get parameter at 0", option.getParameterAt(0), args.get(0));
    assertEquals("Testing get parameter at 1", option.getParameterAt(1), args.get(1));
    assertEquals("Testing get parameter at 2", option.getParameterAt(2), args.get(2));
  }
}
